package cn.northsea.mapper;

import cn.northsea.entity.Appeal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AppealMapper extends BaseMapper<Appeal> {
    @Select("select * from seek_appeal")
    List<Appeal> findAll();
    @Update("update seek_appeal set zt=#{zt} where id=#{id}")
    void updateAppelByState(@Param("id") Integer id, @Param("zt") Integer zt);
    @Insert("insert into seek_appeal values (null,#{type},#{title},#{nr},1,#{uid})")
    void addAppeal(Appeal appeal);
    @Select("select * from seek_appeal where uid=#{id}")
    List<Appeal> getListById(Integer id);
}
